package com.yunxi.model.order;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yunxi.core.web.DateJsonDeserializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 零售订单
 * </p>
 *
 * @author 
 * @since 2019-06-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("pms_order_customer")
@ApiModel(value="OrderCustomer对象", description="零售订单")
public class OrderCustomer implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID")
    @TableId(value = "ORDER_CUSTOMER_ID", type = IdType.UUID)
    private String orderCustomerId;

    @ApiModelProperty(value = "零售单编号")
    @TableField("ORDER_CUSTOMER_NO")
    private String orderCustomerNo;

    @ApiModelProperty(value = "渠道商编号")
    @TableField("PARTNER_CODE")
    private String partnerCode;

    @ApiModelProperty(value = "客户编号")
    @TableField("CUSTOMER_NO")
    private String customerNo;

    @ApiModelProperty(value = "是否支付定金")
    @TableField("IS_FRONT_PAY")
    private Integer isFrontPay;

    @ApiModelProperty(value = "定金金额")
    @TableField("FRONT_MONEY")
    private BigDecimal frontMoney;

    @ApiModelProperty(value = "付款方式")
    @TableField("PAYTYPE")
    private String paytype;

    @ApiModelProperty(value = "发票编号")
    @TableField("INVOICE_CODE")
    private String invoiceCode;

    @ApiModelProperty(value = "开票金额")
    @TableField("INVOICE_MONEY")
    private BigDecimal invoiceMoney;

    @ApiModelProperty(value = "保险公司")
    @TableField("INSURER_TYPE")
    private String insurerType;

    @ApiModelProperty(value = "开票日期")
    @TableField("INVOICE_TIME")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date invoiceTime;

    @ApiModelProperty(value = "交定日期")
    @TableField("DELIVERY_DATE")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date deliveryDate;

    @ApiModelProperty(value = "预计交车日期")
    @TableField("DELIVERY_CAR_DATE")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date deliveryCarDate;

    @ApiModelProperty(value = "保单号")
    @TableField("INSURANCE_NO")
    private String insuranceNo;

    @ApiModelProperty(value = "上牌日期")
    @TableField("CAR_LICENSE")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date carLicense;

    @ApiModelProperty(value = "车牌号")
    @TableField("CAR_NO")
    private String carNo;

    @ApiModelProperty(value = "车主类型")
    @TableField("DRIVIER_TYPE")
    private String drivierType;

    @ApiModelProperty(value = "客户类型")
    @TableField("CUSTOMER_TYPE")
    private String customerType;

    @ApiModelProperty(value = "提货方式 N承运 Y 自提")
    @TableField("DELIVERY_TYPE")
    private String deliveryType;

    @ApiModelProperty(value = "订单来源 1App 2 PC 3pad 9 后台录入")
    @TableField("ORDER_SOURCE")
    private Integer orderSource;

    @ApiModelProperty(value = "1：零售整车2： 直客整车")
    @TableField("ORDER_TYPE")
    private Integer orderType;

    @ApiModelProperty(value = "支付id")
    @TableField("PAY_ID")
    private String payId;

    @ApiModelProperty(value = "是否退定")
    @TableField("IS_FRONT_REFUND")
    private Integer isFrontRefund;

    @ApiModelProperty(value = "订单金额")
    @TableField("AMOUNT")
    private BigDecimal amount;

    @ApiModelProperty(value = "合同编号")
    @TableField("CONTRACT_NO")
    private String contractNo;

    @ApiModelProperty(value = "数量只会是1")
    @TableField("NUM_")
    private Integer num;

    @ApiModelProperty(value = "是否有库存")
    @TableField("IS_LOW_STOCK")
    private String isLowStock;

    @ApiModelProperty(value = "备注")
    @TableField("INFO")
    private String info;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date createTime;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATE_BY")
    private String createBy;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date updateTime;

    @ApiModelProperty(value = "修改人")
    @TableField("UPDATE_BY")
    private String updateBy;

    @ApiModelProperty(value = "状态1启用0禁用")
    @TableField("STATUS")
    private Integer status;

    @ApiModelProperty(value = "是否删除")
    @TableField("IS_DEL")
    private Integer isDel;

    @ApiModelProperty(value = "备注")
    @TableField("MEMO")
    private String memo;

    @ApiModelProperty(value = "版本")
    @TableField("VERSION")
    @Version
    private Integer version;

    @ApiModelProperty(value = "是否发送")
    @TableField("IS_SEND")
    private Integer isSend;

    @ApiModelProperty(value = "用户的aiid")
    @TableField("CUSTOMER_ID")
    private String customerId;

    @ApiModelProperty(value = "用户姓名")
    @TableField("CUSTOMER_NAME")
    private String customerName;

    @ApiModelProperty(value = "用户手机号")
    @TableField("CUSTOMER_MOBILE")
    private String customerMobile;

    @ApiModelProperty(value = "用户证件号")
    @TableField("CERT_NO")
    private String certNo;

    @ApiModelProperty(value = "企业名称")
    @TableField("COMPANY_NAME")
    private String companyName;

    @ApiModelProperty(value = "企业编号(统一社会信用代码)")
    @TableField("COMPANY_CODE")
    private String companyCode;

    @ApiModelProperty(value = "客户地址")
    @TableField("CUSTOMER_ADDRESS")
    private String customerAddress;

    @ApiModelProperty(value = "省编号")
    @TableField("PROVINCE_CODE")
    private String provinceCode;

    @ApiModelProperty(value = "城市编号")
    @TableField("CITY_CODE")
    private String cityCode;

    @ApiModelProperty(value = "邀请人姓名")
    @TableField("INVITOR_NAME")
    private String invitorName;

    @ApiModelProperty(value = "邀请人手机")
    @TableField("INVITOR_MOBILE")
    private String invitorMobile;

    @ApiModelProperty(value = "订单状态 1-9")//1-->待付款2-->小订付款完成3-->大订已付款，4-->订单已评价5-->已超时6-->小订已取消7-->小订申请退款8-->小订退款成功 9-->小订退款失败
    @TableField("ORDER_STATUS")
    private Integer orderStatus;

    @ApiModelProperty(value = "订单流水号")
    @TableField("ORDER_NO")
    private String orderNo;

    @ApiModelProperty(value = "预定的产品包id")
    @TableField("PRODUCT_PACKAGE_ID")
    private String productPackageId;

    @ApiModelProperty(value = "订单总金额")
    @TableField("TOTAL_AMOUNT")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "优惠金额")
    @TableField("DISCOUNT_AMOUNT")
    private BigDecimal discountAmount;

    @ApiModelProperty(value = "订车类型 1个人 2企业")
    @TableField("BOOKING_TYPE")
    private String bookingType;

    @ApiModelProperty(value = "车主姓名")
    @TableField("DRIVER_NAME")
    private String driverName;

    @ApiModelProperty(value = "车主电话")
    @TableField("DRIVER_TEL")
    private String driverTel;

    @ApiModelProperty(value = "提车人姓名")
    @TableField("TAKE_CAR_NAME")
    private String takeCarName;

    @ApiModelProperty(value = "提车人电话")
    @TableField("TAKE_CAR_TEL")
    private String takeCarTel;

    @ApiModelProperty(value = "业务类型0 小订 1 大订")
    @TableField("BUS_TYPE")
    private Integer busType;

    @ApiModelProperty(value = "业务状态")
    @TableField("BUS_STATUS")
    private Integer busStatus;

    @ApiModelProperty(value = "VIN")
    @TableField("VIN")
    private String vin;

    @ApiModelProperty(value = "订单交易流水号")
    @TableField("OUT_TRADE_NO")
    private String outTradeNo;

    private Integer isCancel;       //是否退订
    private String cancelReason;  //退订原因
    private Integer cancelAudit;    //退订是否审核
    private transient String cancelAuditCn;
    private String auditUserId;    //审核人
    private Date cancelDate; //取消时间
    private Date auditDate;
    private String idImgPath1;
    private String idImgPath2;
    private transient String busTypeCn;

    private BigDecimal smallAmount;//小订金额
    private Date smallPayDate;//付款时间
    private Integer smallPayPath;//付款途径

    private BigDecimal bigAmount;//大订金额
    private Date bigPayDate;//	大订时间
    private Integer bigPayPath;//大订途径
    private BigDecimal finalAmount;//	尾款金额
    private Date finalDate;	//尾款时间
    private Integer finalPayPath;//尾款途径
    private Integer payStyle;	//付款方式

    private String certType;

    @TableField("IS_CHARGING_POINT")
    private Integer isChargingPoint;

    @TableField("LENDER")
    private String lender;//贷款公司

    @TableField("LOAN_PERIODS")
    private Integer loanPeriods;//贷款期数

    @TableField("CONTRACT_IMG_PATH")
    private String contractImgPath;//合同图片地址

    private String salesConsultantNo;

    private String regionCode; //区

    private String fullAreaName;

    private String bigRegion;//大区


    @ApiModelProperty(value = "是否退款")
    private Integer isCancelMoney;

    @ApiModelProperty(value = "是否退车")
    private Integer isCancelVehicle;

    @ApiModelProperty(value = "购车方案 1-->购车 2-->体验车 3-->畅想车")
    private Integer buyType;

    @ApiModelProperty(value = "订单名称")
    private String orderSubject;

    @ApiModelProperty(value = "预估金额")
    private BigDecimal orderAmount;

    @ApiModelProperty(value = "国家补贴")
    private BigDecimal stateSubsidy;

    @ApiModelProperty(value = "地方补贴")
    private BigDecimal localSubsidy;

    @ApiModelProperty(value = "客户经理id")
    private String fellowId;

    @ApiModelProperty(value = "客户经理姓名")
    private String fellowName;

    @ApiModelProperty(value = "客户经理手机号")
    private String fellowMobile;

    @ApiModelProperty(value = "客户经理性别")
    private String fellowGender;

    @ApiModelProperty(value = "客户经理头像url")
    private String fellowAvatar;

    @ApiModelProperty(value = "能量值")
    private String energyPoint;

    @ApiModelProperty(value = "车辆状态1待生产2生产计划3进焊装4出焊装5进涂装6出涂装7进总装8出总装9车辆下线10VDC未入道闸11VDC入库12VDC出库13退货入库14在途15渠道收车16渠道入库17零售出库18零售退货")
    private Integer vehicleStatus;

    @ApiModelProperty(value = "购车金额")
    private BigDecimal buyAmount;

    @ApiModelProperty(value = "驳回原因")
    private String rejectReason;

    @ApiModelProperty(value = "交车人")
    private String handleUser;

    private String refundOrderNo;//退款申请单号

    private Date hireStartDate;
    private Date hireEndDate;

    @ApiModelProperty(value = "是否上传合同图片")
    private String isUpload;
    private Integer isHide;
}